//
//  UserPresenter.m
//  Lmm_IOS
//
//  Created by 张哲炜 on 2018/10/11.
//  Copyright © 2018 lmm. All rights reserved.
//

#import "UserPresenter.h"

@implementation UserPresenter

+ (void) logout :(void (^)(void))start successBlock:(void (^)(UserModel *user, MessageModel *msg))success failureBlock:(void (^)(NSError *error))failure finishBlock:(void (^)(void))finish{
    
    start();
    
    [HttpHelper request:@"user/logout" :@"POST" :nil successBlock:^(NSDictionary *responseDic) {
        
        MessageModel *msg = [MessageModel mj_objectWithKeyValues:responseDic];
        
        UserModel * user = [UserModel mj_objectWithKeyValues:[responseDic objectForKey:@"data"]];
        
        finish();
        success(user, msg);
        
    } failureBlock:^(NSError *error) {
        finish();
        failure(error);
    }];
    
    
}



@end
